<template>
       <el-row :gutter="10" style="margin-top: 10px">
            <el-col :xs="24" :md="24" :lg="24">
                <el-card v-loading="refreshLoading">
                    <p slot="header">
                        <i class="ios-film-outline" />
                       	Lazada数据：
                         <el-button size="small"  @click="type=0;getIndex()" :type="type==0?'primary':'default'">{{$t('今天')}}</el-button>

                          <el-button size="small"  @click="type=-1;getIndex()" :type="type==-1?'primary':'default'">{{$t('昨天')}}</el-button>
                        <a href="#" style="float: right;" @click.prevent="getIndex()">
                            <i class="ios-loop-strong" />
                            刷新
                        </a>
                         <el-checkbox  style="margin-left: 10px;" v-model="waybillState" :true-label="1" :false-label="0" @change="getIndex();" >不含测评</el-checkbox>
                    </p>
                    <el-row :gutter="20">
                        <el-col :xs="3" :md="3" :lg="3" v-for="(vl,ky) in allDatas">
                             <div class="info-card">
                                <div class="info-card-count">
                                  <el-statistic group-separator="," :precision="2" :value="vl.price" :title="vl.country"></el-statistic>  
                                </div>
                                <h3 class="info-card-title">{{vl.count}}单</h3>
                            </div>
                        </el-col>
                       
                    </el-row>
                </el-card>
            </el-col>
        </el-row>
</template>
<script>

export default {
    name: "Index",
    data() {
        return {
          type:0,
          waybillState:0,
           allDatas: {
                
            },
            refreshLoading: false,
          

        }
    },
    mounted: function() {
       
       this.getIndex();
   
    },
    methods: {
        
        getIndex: function() {
            var me = this;
            me.refreshLoading = true;
            me.$http.post("/stastis/lazadaIndex.do", {type:me.type,waybillState:me.waybillState}).then(response => {
                var body = response;
                if (body.status == 0) {
                    me.allDatas = body.obj;
                }
                me.refreshLoading = false;
            }, response => {
                me.refreshLoading = false;
            });
        },
        


       
        goRecharge: function() {
            this.$router.push({ name: "RechargeAdd" })
        },
        updateRate: function() {

        }


    },
    components: {
      

    }
}
</script>
<style scoped>
.info-card {
    text-align: center;
    background-color: #fff;
    padding-bottom: 20px;
}

.info-card-count {

    font-size: 15px;
}

.info-card-title {
    font-size: 20px;
}




</style>